package com.example.smartcity_poverty.ui.AllService.TakeOutTr

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.MenuItem
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import androidx.recyclerview.widget.LinearLayoutManager
import com.example.smartcity_poverty.R
import kotlinx.android.synthetic.main.activity_take_out_home.*


/**
 * TODO 外卖订餐模块
 */
class TakeOutHomeActivity : AppCompatActivity() {

    private val tag = this.javaClass.simpleName

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_take_out_home)
        // 隐藏标题栏
        supportActionBar?.hide()

        // 获取与给定Fragment容器视图关联的NavController
        val findNavController = findNavController(R.id.take_nav_host_fragment)
        // 创建AppBarConfiguration对象，指定顶层目的地的ID，这将影响ActionBar的行为
        val appBar = AppBarConfiguration(
            setOf(
                R.id.NavTakeHomeFragment,
                R.id.NavTakeListFragment,
                R.id.NavTakeMyFragment
            )
        )
        // 将ActionBar与NavController相关联，使得ActionBar能够响应导航图中的目的地变化
        setupActionBarWithNavController(findNavController, appBar)
        // 将底部导航栏与NavController相关联，使得底部导航栏能够响应导航图中的目的地变化
        take_nav_view.setupWithNavController(findNavController)
    }
}